
<ul class="left-category">
<?php $get_params=$this->request->params['controller'].'/'.$this->request->params['action'].'/'.$params; 
$get_params_none=$this->request->params['controller'];
foreach($menusleft as $menu){
?>
    <li class="<?php echo (!empty($this->params['action']) && ($get_params==$menu['Menu']['url'] || $get_params==$menu['Menu']['url'].'posts/index/' || $get_params_none==$menu['Menu']['url']) )?'active' :'' ?>">
    <a href="<?php echo $this->webroot.$menu['Menu']['url']; ?>"><?php echo $menu['Menu']['title']; ?></a>
    <?php 
    if($get_params==$menu['Menu']['url']){
         if($categories) {
     
        echo '<ul class="brands-'.$params.'">';
        foreach($categories as $category) {
            $i = 0;
            echo '<li>';
            //echo $category['Category']['name'];
            foreach ($allbrands as $product) {
                if($category['Category']['id'] == $product['Product']['category_id']){
                    $i++;
                }
            }
            echo '<span class="pro-title">'.$this->Html->link($category['Category']['name'].'('.$i.')', array('controller' => 'categories', 'action' => 'cat', $category['Category']['id'], $category['Category']['parent_id'])).'</span>';
            echo '</li>';
        }
        echo '</ul>';
    }
   
    } ?>
  
</li>
<?php

}
 
?>
</ul>
